<?php

function reequipment_adminapi_deletefrequency($args)
{
    // Get arguments from argument array
    extract($args);
    // Argument check
    if (!isset($frequency_id)) {
        $msg = xarML('Invalid Parameter Count');
        xarErrorSet(XAR_SYSTEM_EXCEPTION, 'BAD_PARAM', new SystemException($msg));
        return;
    }

    // The user API function is called
    $test_id = xarModAPIFunc('reequipment',
                          'user',
                          'getfrequency',
                          array('frequency_id' => $frequency_id));
    if ($test_id == false) return;

    // Get datbase setup
    $dbconn =& xarDBGetConn();
    $xartable =& xarDBGetTables();
    $table = $xartable['refrequency'];

    // Delete the item
    $query = "DELETE FROM $table
            WHERE frequency_id = ?";
    $bindvars = array($frequency_id);
    $result =& $dbconn->Execute($query,$bindvars);
    if (!$result) return;
    return true;
}
?>